package com.REPDPMSystem.Mapper;

import com.REPDPMSystem.Entity.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

//客户信息：增删改查！
@Repository
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {
//    @Select("SELECT c.*," +
//            "b.name AS organization_1_name, " +
//            "d.name AS organization_2_name " +
//            "FROM customer c " +
//            "LEFT JOIN organization_1 b ON c.customer_organization_I = b.id " +
//            "LEFT JOIN organization_2 d ON c.customer_organization_II = d.id " +
//            "WHERE c.customer_organization_I = #{organizationI} " +
//            "AND c.customer_organization_II = #{organizationII}")
//    List<Customer> selectCustomerByOrganizations(String organizationI, String organizationII);

//    @Select("SELECT c.*," +
//           "b.name AS organization_1_name, " +
//           "d.name AS organization_2_name " +
//           "FROM customer c " +
//           "LEFT JOIN organization_1 b ON c.customer_organization_I = b.id " +
//           "LEFT JOIN organization_2 d ON c.customer_organization_II = d.id " +
//           "WHERE c.customer_organization_I = #{organizationI} " +
//           "AND c.customer_organization_II = #{organizationII}")
//    List<Customer> selectCustomerByOrganizations(@Param("organizationI") String organizationI, @Param("organizationII") String organizationII);


}

